
//## 통계 표시 ####################

function fnNewGrid01()
{
	var valUrl = "/action/statistics/list.asp";
	var param = "findYear="+encodeURIComponent($("#findYear").val());
		param += "&findType="+$("#findType").val();
		param += "&findField="+$("#findField").val();
		param += "&findSection="+$("#findSection").val();

	if (xMode=="debug") window.open(valUrl+'?xMode=debug&'+param);

	$.ajax({
		url: valUrl,
		type: 'POST',
		dataType: 'xml',
		data: param,
		success: function(xml){
			//## 로그인 체크
			fnSessionCheck($(xml).find("MSG").text());
			
			var rows = "";
			$(xml).find("Stat").each(function()
			{
				var prdGrp = $(this).find("prdGrp").text();
				var m01 = $(this).find("m01").text();
				var m02 = $(this).find("m02").text();
				var m03 = $(this).find("m03").text();
				var m04 = $(this).find("m04").text();
				var m05 = $(this).find("m05").text();
				var m06 = $(this).find("m06").text();
				var m07 = $(this).find("m07").text();
				var m08 = $(this).find("m08").text();
				var m09 = $(this).find("m09").text();
				var m10 = $(this).find("m10").text();
				var m11 = $(this).find("m11").text();
				var m12 = $(this).find("m12").text();
				var total = $(this).find("total").text();
				var bold = "";
				var cdPrdGrp = prdGrp;
				if (prdGrp == "ZZ총량") { bold = "font-weight:bold;"; prdGrp="총계"; cdPrdGrp="all"; }
				var firstWidth = "130px";
				if (G_version == "8") firstWidth = "140px";

				rows += "<div id=\"rows\" class=\"cellBody\" onclick=\"fnSetGraph('"+cdPrdGrp+"')\" style=\"width:"+firstWidth+";text-align:center;font-weight:bold;cursor:pointer\">"+prdGrp+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m01+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m02+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m03+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m04+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m05+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m06+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m07+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m08+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m09+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m10+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m11+"</div>";
				rows += "<div class=\"cellBody\" style=\""+bold+"\">&nbsp;"+m12+"</div>";
				rows += "<div class=\"cellBodyLast\" style=\""+bold+"\">"+total+"</div>";

			});
			
			$("#Titles").html($("#findYear").val()+"년 통계");
			$("#gridBody").html(rows);
			 fnSetGraph("");
		},
		error: function(xml){
			alert('Error!!');
			alert(xml.responseText);
		}
	});
}